Skip to main content

tabStops

Type

property

Summary

Specifies the location of tab stops in a field.

Syntax

set the tabStops [of line <lineNumber>] of <field> to <tabStopList>

Description

Use the tabStops property to let users tab to a horizontal location within a field.

If the user presses the <Tab> key while editing a field, normally the insertion point moves to the next control whose traversalOn property is true. If the tabStops property is not empty, the user can enter tab characters in the field. Each time the Tab key is pressed, the insertion point moves to the next tab stop on the current line.

The tabStops consists of one or more integers separated by commas. Each integer is the distance in pixels from the left margin of the field to a tab stop, after taking into account the leftIndent and firstIndent properties. For example, if the leftIndent is 20 pixels, the firstIndent is 25 pixels, and the first item of the tabStops is 30 pixels, the first tabstop will be 75 pixels from the left margin of the field.

If a tab stop is less than the previous tab stop, the distance is measured relative to the previous tab stop. For example, if the tabStops is set to "20,100,30", tab stops are placed at 20, 100, and 130 pixels from the left margin.

tip

If you set the field's vGrid property to true, a vertical line is drawn at each tab stop. Temporarily setting this property to true can help you get a better idea of where each tab stop is.

If the tabStops does not define tabs for the entire width of the field, or if the field's dontWrap property is true, LiveCode creates implicit tab stops across the entire field. (For example, if a field's tabStops is 10, the field has a tab stop every 10 pixels.) If the tabStops property defines more than one tab stop, the width of the last tab column repeats for the width of the field. (For example, if a field's tabStops is 20,100,130, the width of the last tab column is 30, so additional tab stops are automatically created at 160, 190, 220, and so on.)

If the tabStops is empty, the field has no tab stop|tab stops, and pressing the Tab key moves the insertion point to the next field.

Important

Setting the field's textAlign to center or right may cause unexpected results when using tab stops.

note

If the tabGroupBehavior property of a group containing the field is set to true, you cannot press the Tab key to go to the next tab stop. (The tabStops setting still controls the spacing of any tab characters that are pasted into the field or placed in it by a handler.)

Examples

set the tabStops of field "Comments" to 20
set the tabStops of field 1 to 40,80,120,160,200
if the tabStops of me is empty then answer "Sorry - can't tab."
set the tabStops of line 2 to -2 of field "list" to 50

keyword: field, integer, characters

message: tabKey

object: field

property: leftIndent, borderWidth, autoTab, vgrid, textAlign, dontWrap, tabGroupBehavior, formattedText, spaceAbove, backgroundColor, listBehavior, listIndent, hidden, textSize, width, firstIndent, spaceBelow, listStyle, rightIndent, listDepth, hgrid, pixels, hScrollbar, borderColor, formattedWidth

glossary: property, insertion point, tab stop, integer, handler

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?